package com.rp.system.corn.service;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.rp.common.result.ResultDTO;
import com.rp.system.corn.entity.QuartzJob;

import java.util.List;

public interface JobService {

    IPage<QuartzJob> listQuartzJob(String jobName, Integer pageNo, Integer pageSize);

    /**
     * 新增job
     * @param quartz
     * @return
     */
    ResultDTO saveJob(QuartzJob quartz);

    /**
     * 触发job
     * @param jobName
     * @param jobGroup
     * @return
     */
    ResultDTO triggerJob(String jobName, String jobGroup);

    /**
     * 暂停job
     * @param jobName
     * @param jobGroup
     * @return
     */
    ResultDTO pauseJob(String jobName, String jobGroup);

    /**
     * 恢复job
     * @param jobName
     * @param jobGroup
     * @return
     */
    ResultDTO resumeJob(String jobName, String jobGroup);

    /**
     * 移除job
     * @param jobName
     * @param jobGroup
     * @return
     */
    ResultDTO removeJob(String jobName, String jobGroup);

    QuartzJob getJob(String jobName, String jobGroup);

    ResultDTO updateJob(QuartzJob quartz);

    void schedulerJob(QuartzJob job) throws Exception;

    List<QuartzJob> listJobByGroup(String jobGroup);
}